# Contributor: Luca Weiss <luca@lucaweiss.eu>
# Maintainer: Luca Weiss <luca@lucaweiss.eu>
pkgname=ayatana-indicator-keyboard
pkgver=24.7.0
pkgrel=0
pkgdesc="Ayatana Indicator Keyboard Applet"
url="https://github.com/AyatanaIndicators/ayatana-indicator-keyboard"
arch="all !s390x !riscv64" # blocked by accountsservice-dev
license="GPL-3.0-only"
makedepends="
	accountsservice-dev
	cmake
	cmake-extras
	glib-dev
	intltool
	libayatana-common-dev
	libx11-dev
	libxkbcommon-dev
	libxklavier-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-lang"
source="https://github.com/AyatanaIndicators/ayatana-indicator-keyboard/archive/$pkgver/ayatana-indicator-keyboard-$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DENABLE_TESTS=ON \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
a0f0abaedc3d1c2295295d746c627cc758788f9f0c1e3e955092b83a43672e95f55a5593b239228def29e2c15b74a0199a7989c250d7c52719729d8667829c02  ayatana-indicator-keyboard-24.7.0.tar.gz
"
